package com.ybxx.hr.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.hr.dao.SchoolDao;
import com.ybxx.hr.model.Dept;
import com.ybxx.hr.model.School;
import com.ybxx.hr.service.SchoolService;

public class SchoolServiceImpl extends BaseServiceImpl<School> implements
		SchoolService {
	private SchoolDao schoolDao;
	public SchoolServiceImpl(SchoolDao dao) {
		super(dao);
		this.schoolDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<School> queryPage(School school,QueryFilter filter) {
		String hql="from School s";
		String condition=" where ";
		if(school!=null && StringUtils.isNotEmpty(school.getSname())){
			hql+=condition+" s.sname='"+school.getSname()+"' ";
		}
		return schoolDao.findByHql(hql, null,filter.getPagingBean());
	}
}
